SDXL Inpainting & Outpainting 基本操作

SDXL Inpainting & Outpainting 基本操作

下載 Juggernaut XL Inpainting 模型

這裡前往 https://civitai.com/models/862813?modelVersionId=965389 | 6.46 GB
檔案名稱:juggernautXLInpainting_xiInpainting.safetensors
把下載的檔案放置在 ComfyUI/models/checkpoints/ 檔案夾中。

下載外掛節點

在 ComfyUI 裡面,開啟 Manager > Custom Nodes Manager。在左上角的搜尋欄位輸入想要的外掛名稱,安裝即可

搜尋 inpaint Corp And Stitch
安裝 ComfyUI-Inpaint-CorpAndStitch 這個外掛

Inpainting

常見的翻譯有:影像修復、圖像修復、修復圖片、局部重繪...等。
Inpainting 主要用於修復、替換或擴展圖片中的特定區域。你可以把它想像成一個數位修圖工具,讓修圖過程更聰明、更自然。
Outpainting 主要是擴展圖片的邊界,創造出更大的畫面,並在擴展的部分生成新的、與原始圖片風格一致的內容。 簡單來說,就是讓圖片「長大」。

幾個一些 Inpainting 的主要用途:

Outpainting

常見的翻譯有:影像擴展、圖像擴展、填補圖像、影像填補、拓圖...等
Outpainting 主要是擴展圖片的邊界,創造出更大的畫面,並在擴展的部分生成新的、與原始圖片風格一致的內容。 簡單來說,就是讓圖片「長大」。
與 Inpainting 僅修改圖片內部區域不同,Outpainting 專注於擴展圖片的外部區域

以下是一些 Outpainting 的主要用途:

Parameters 節點參數

這是官方的節點參數說明。透過大型語言模型翻譯如下:

  • downscale_algorithm and upscale_algorithm: Which algorithms to use when resizing an image up or down. 調整圖片大小(放大或縮小)時使用的演算法。
  • preresize: Shows options to resize the input image before any cropping: to ensure minimum resolution, to ensure maximum resolution, to ensure both minimum and maximum resolution. This makes it very convenient to ensure that any input images have a certain resolution. 顯示在任何裁剪之前調整輸入圖片大小的選項:以確保最小解析度、以確保最大解析度、或同時確保最小和最大解析度。這使得確保任何輸入圖片具有特定解析度非常方便。
  • mask_fill_holes: Whether to fully fill any holes (small or large) in the mask, that is, mark fully enclosed areas as part of the mask. 是否完全填充遮罩中的任何孔洞(小或大),也就是將完全封閉的區域標記為遮罩的一部分。
  • mask_expand_pixels: Grows the mask by the specified amount of pixels. 將遮罩擴展指定的像素數量。
  • mask_invert: Whether to fully invert the mask, that is, only keep what was masked, instead of removing what was marked. 是否完全反轉遮罩,也就是僅保留被遮罩的部分,而不是移除被標記的部分。
  • mask_blend_pixels: Grows the stitch mask and blurs it by the specified amount of pixels, so that the stitch is slowly blended and there are no seams. 擴展縫合遮罩並模糊指定的像素數量,使縫合逐漸融合,且沒有接縫。
  • mask_hipass_filter: Ignores mask values lower than the one specified here. This is to avoid sections in the mask that are almost 0 (black) to count as masked area. Sometimes that leads to confusion, as the user believes the area is not really masked and the node is considering it as masked. 忽略低於這裡指定值的遮罩值。這是為了避免遮罩中幾乎為 0(黑色)的部分被視為遮罩區域。有時這會導致混淆,因為使用者認為該區域沒有被遮罩,而節點卻將其視為已遮罩。
  • extend_for_outpainting: Shows options to extend the mask in any/all directions (up/down/left/right) by a certain factor. >1 extends the image, e.g. 2 extends the image in a direction by the same amount of space the image takes. <1 crops the image, e.g. 0.75 removes 25% of the image on that direction. 顯示選項,在任何方向(上/下/左/右)上,按特定比例擴展遮罩。>1 擴展圖像,例如 2 將圖像在一個方向上擴展與圖像所佔空間相同的量。<1 裁剪圖像,例如 0.75 移除該方向上 25% 的圖像。
  • context_from_mask_extend_factor: Extends the context area by a factor of the size of the mask. The higher this value is, the more area will be cropped around the mask for the model to have more context. 1 means do not grow. 2 means grow the same size of the mask across every direction. 按遮罩大小的比例擴展上下文區域。此值越高,模型為了獲得更多上下文,將裁剪的區域越大。1 表示不擴展。2 表示在每個方向上擴展與遮罩大小相同的量。
  • output_resize_to_target_size: Forces that the cropped image has a specific resolution. This may involve resizing and extending out of the original image, but the stitch node reverts those changes to integrate the image seamlessly. 強制裁剪後的圖像具有特定解析度。這可能涉及調整和超出原始圖像的大小,但縫合節點會恢復這些更改以無縫集成圖像。
  • output_padding: Ensures that the cropped image width and height are a multiple of this padding value. Models require images to be padded to a certain value (8, 16, 32) to function properly. 確保裁剪後的圖像寬度和高度是此填充值的倍數。模型需要將圖像填充到特定值(8、16、32)才能正常工作。


References